import App from './App.vue';
import router from './router';
import mitt from 'mitt';
import VueLazyload from 'vue-lazyload';

import { createApp } from 'vue';
import { createPinia } from 'pinia';

import '@/styles/iconfont.scss';
import '@/styles/common.scss';
import 'normalize.css';
import 'animate.css';

const app = createApp(App);

// 注册全局组件传值mitt通信工具
app.config.globalProperties.$mitt = mitt();

// 注册全局组件
import myPlugins from '@/components/index.js';
app.use(myPlugins);

// 配置懒加载选项
import placeholder from '@/assets/images/global/lazyload/placeholder.svg';
app.use(VueLazyload, {
  loading: placeholder, // 占位图像路径
  error: placeholder, // 错误时显示的图像路径
});

app.use(createPinia());
app.use(router);
app.mount('#app');
